package heven.holt.library.database.dao

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import heven.holt.library.model.DownloadInfo

@Dao
interface DownloadDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insertOrUpdate(downloadInfo: DownloadInfo)

    @Query("SELECT * FROM DownloadInfo WHERE url == :url")
    fun getDownloadInfoByUrl(url: String): DownloadInfo?
}